package com.example.apricots.Services;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.example.apricots.Utils.MobileDetail;

public class NetService extends BroadcastReceiver {
    private static final String TAG = NetService.class.getSimpleName();

    @Override
    public void onReceive(Context context, Intent intent) {
        String netstate=MobileDetail.getNetworkType(context);
        Toast.makeText(context,"当前网络状态:"+netstate,Toast.LENGTH_SHORT).show();
        Log.e(TAG, "onReceive: "+ netstate );
    }
}
